package exp.parser;

import grammar.parser.FuncFParams;

public class NotExp extends UnaryExp {
    private final ExpParser exp;

    public NotExp(ExpParser exp) {
        super(false, exp.isConst());
        this.exp = exp;
    }


    @Override
    public LVal toLVal() {
        return null;
    }

    @Override
    public Integer compute() {
        if (exp.getValue() != 0) {
            return 0;
        } else {
            return 1;
        }
    }

    @Override
    public FuncFParams.FuncFParam checkDimension() {
        return new FuncFParams.FuncFParam(0, 0);
    }
}
